@import controllers.admin.TesksForm
@import models.tasks.JobInfo
@(taskForm: Form[TesksForm],taskInfo:JobInfo,jobNames:Array[String]=Array())(implicit request: RequestHeader,messagesProvider: MessagesProvider,session:Session)
@import helper._

<div class="" style="width:300px;height: 200px;">
    @form(controllers.admin.routes.TasksController.addTask()) {
    <input type="text" hidden name="id" id="id" value="@taskInfo.id">
    <dl class=" " id="taskname_field">
        <dt><label for="taskname">taskname</label></dt>
        <dd>
            <select id="taskname" name="taskname" lay-verify="required">
                @for(job<-jobNames){
                <option value="@job" @if(job==taskInfo.name){selected}>@job</option>
                }
            </select>
        </dd>
        <dd class="info">Required</dd>
    </dl>
    <dl class=" " id="cron_field">
        <dt><label for="cron">cron</label></dt>
        <dd>
            <input type="text" id="cron" name="cron" value="@taskInfo.cronExpression">
        </dd>
    </dl>
    <dl class=" " id="description_field">
        <dt><label for="description">description</label></dt>
        <dd>
            <input type="text" id="description" name="description" value="@taskInfo.description">
        </dd>
    </dl>
    <dl class=" " id="status_field">
        <dt><label for="status">status</label></dt>
        <dd>
            <div class="layui-input-block">
                <input type="checkbox" id="status" name="status" lay-skin="switch" lay-text="开启|关闭" @if(taskInfo.status){checked} disabled>
            </div>
        </dd>
    </dl>

    @CSRF.formField

    <div class="buttons">
        <input type="submit" value="edit"/>
    </div>
    }
</div>
